﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Barbar.MapReport.DataSource.Query {
  public class AndOperator : RegionCriteria {
    private RegionCriteria m_FirstMember;
    private RegionCriteria m_SecondMember;

    public AndOperator() {
    }

    public AndOperator(RegionCriteria firstMember, RegionCriteria secondMember) {
      m_FirstMember = firstMember;
      m_SecondMember = secondMember;
    }

    public RegionCriteria FirstMember {
      get { return m_FirstMember; }
      set { m_FirstMember = value; }
    }

    public RegionCriteria SecondMember {
      get { return m_SecondMember; }
      set { m_SecondMember = value; }
    }

    internal override bool Evaluate(Region region) {
      return m_FirstMember.Evaluate(region) && m_SecondMember.Evaluate(region);
    }
  }
}
